package pta.newch04.ex18;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int innerRadius = scanner.nextInt();
        int outerRadius = scanner.nextInt();
        Ring ring1 = new Ring(innerRadius, outerRadius);
        System.out.println(ring1.getArea());
        Ring ring2 = new Ring();
        System.out.println(ring2.getArea());
        scanner.close();
    }
}

class Ring{
    public Ring(int innerRadius, int outerRadius) {
        System.out.println("constructor");
        this.innerRadius = innerRadius;
        this.outerRadius = outerRadius;
    }
    public Ring(){
        this(1,3);
    }

    public int getInnerRadius() {
        return innerRadius;
    }

    public void setInnerRadius(int innerRadius) {
        this.innerRadius = innerRadius;
    }

    public int getOuterRadius() {
        return outerRadius;
    }

    public void setOuterRadius(int outerRadius) {
        this.outerRadius = outerRadius;
    }

    private int innerRadius;
    private int outerRadius;

    public int getArea() {
        double area = Math.PI * (outerRadius*outerRadius - innerRadius*innerRadius);
        return (int) area;
    }
}